<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">我的资料</div>
                <div class="layui-card-body" pad15>

                    <div class="layui-form layui-form-pane" lay-filter="{$lay_table}">
                        <div class="layui-form-item">
                            <label class="layui-form-label">我的角色</label>
                            <div class="layui-input-inline">
                                <input type="text" name="admin_name" value="{:array_get($admin,'role_text')}" readonly
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">当前角色不可更改为其它角色</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">登录名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="admin_name" value="{:array_get($admin,'admin_name')}" readonly
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">不可修改，用于后台登录名</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span style="color:#f90c05;">*</span>姓名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="realname" value="{:array_get($admin,'realname')}" lay-verify="required"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">手机号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="mobile" value="{:array_get($admin,'mobile')}" lay-verify="phone"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item" pane>
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-block">
                                <textarea name="remark" placeholder="请输入内容"
                                          class="layui-textarea">{:array_get($admin,'remark')}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">确认修改
                                </button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['index'], function () {
        const admin = layui.admin;
        const form = layui.form;
        form.render();

        form.on('submit({$lay_btn})', function (obj) {
            admin.req({
                url: "{:url('admin/editmyinfo')}",
                data: obj.field,
                done: function (res) {
                    layer.msg("提交成功", {
                        icon: 1
                    });
                }
            });

        });
    });
</script>
